home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWRecShp.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.3 KB  |  114 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWRecShp.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWRECSHP_H
  11. #define FWRECSHP_H
  12.  
  13. #ifndef FWSHAPE_H
  14. #include "FWShape.h"
  15. #endif
  16.  
  17. #ifndef FWBNDSHP_H
  18. #include "FWBndShp.h"
  19. #endif
  20.  
  21. #if FW_LIB_EXPORT_PRAGMAS
  22. #pragma lib_export on
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_CLASS_ATTR FW_CGraphicContext;
  30.  
  31. //=======================================================================================
  32. //    class FW_CRectShape
  33. //=======================================================================================
  34.  
  35. class FW_CLASS_ATTR FW_CRectShape : public FW_CBoundedShape
  36. {
  37. public:
  38.     FW_DECLARE_CLASS
  39.  
  40. //----------------------------------------------------------------------------------------
  41. //    Constructors/Destructors
  42. //
  43. public:
  44.     FW_CRectShape();
  45.     FW_CRectShape(const FW_CRect& rect, 
  46.                   FW_ERenderVerbs renderVerb,
  47.                   const FW_PInk& ink = FW_kNormalInk,
  48.                   const FW_PStyle& style = FW_kNormalStyle);
  49.  
  50.     FW_CRectShape(const FW_CRectShape& other);
  51.     FW_CRectShape(FW_CReadableStream& archive);
  52.     
  53.     virtual ~ FW_CRectShape();
  54.         
  55. //----------------------------------------------------------------------------------------
  56. //    Inherited API
  57. //
  58. public:
  59.     // ----- Hit Testing -----
  60.     virtual FW_Boolean         HitTest(FW_CGraphicContext& gc,
  61.                                         const FW_CPoint& test,
  62.                                         FW_CFixed tolerance) const;
  63.  
  64.     // ----- Copying -----
  65.     virtual FW_CShape*            Copy() const;
  66.     
  67.     // ----- Rendering -----
  68.     virtual void                 Render(FW_CGraphicContext& gc) const;
  69.     
  70. //----------------------------------------------------------------------------------------
  71. //    New API
  72. //
  73. public:
  74.     // ----- Geometry -----
  75.     void                        SetGeometry(const FW_CRect& rect);
  76.     void                         GetGeometry(FW_CRect& rect) const;
  77.                         
  78.     // ----- Static rendering method -----
  79.     static void                 RenderRect(FW_CGraphicContext& gc,
  80.                                             const FW_CRect& rect, 
  81.                                             FW_ERenderVerbs renderVerb,
  82.                                             const FW_PInk& ink = FW_kNormalInk,
  83.                                             const FW_PStyle& style = FW_kNormalStyle);
  84.     // ----- Archiving -----
  85.     static void*                Read(FW_CReadableStream& archive);
  86.  
  87. };
  88.  
  89. //=======================================================================================
  90. //    Inlines
  91. //=======================================================================================
  92.  
  93. //----------------------------------------------------------------------------------------
  94. //    FW_CRectShape::GetGeometry
  95. //----------------------------------------------------------------------------------------
  96. inline void FW_CRectShape::GetGeometry(FW_CRect& rect) const
  97. {
  98.     rect = fRect;
  99. }
  100.  
  101. //----------------------------------------------------------------------------------------
  102. //    FW_CRectShape::SetGeometry
  103. //----------------------------------------------------------------------------------------
  104. inline void FW_CRectShape::SetGeometry(const FW_CRect& rect)
  105. {
  106.     fRect = rect;
  107. }
  108.  
  109. #if FW_LIB_EXPORT_PRAGMAS
  110. #pragma lib_export off
  111. #endif
  112.                 
  113. #endif
  114.